/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.ControlEscolar.Validations;

import com.ControlEscolar.Beans.Enrollment;
import com.ControlEscolar.Beans.Student;
import com.ControlEscolar.DAOs.DAOException;
import com.ControlEscolar.DAOs.EnrollmentDAO;
import com.ControlEscolar.DAOs.StudentDAO;
import java.util.ArrayList;

/**
 *
 * @author Bere
 */
public class ValidationStudent extends BasicValidation{
    StudentDAO studentDAO=new StudentDAO();
    EnrollmentDAO inscriptionDAO=new EnrollmentDAO();

     public boolean isExistStudent(String studentKey, String CURP) throws DAOException{
       Student searchStudent=studentDAO.queryByKeyCURP(studentKey, CURP);
        return isFound(searchStudent);
     }

     public boolean isExistStudentKey(String studentKey) throws DAOException{
       Student searchStudent=studentDAO.queryByKey(studentKey);
       return isFound(searchStudent);
   }
     
     public boolean isStudentEnrolled(String studentKey) throws DAOException{
         ArrayList <Enrollment> searchStudentEnrolled=inscriptionDAO.queryByStudentKey(studentKey);
         return isFound(searchStudentEnrolled);
     }

    public boolean isDropStudent(String studentKey) throws DAOException{
        Student searchStudent =studentDAO.queryStudentInactiveState(studentKey);
        return isFound(searchStudent);
    }

     
}
